import request from "@/utils/request";

// 查询资产分类列表
export function listCategories(query) {
  return request({
    url: "/admin/assets/categories/",
    method: "get",
    params: query
  });
}

// 查询资产分类详细
export function getCategories(id) {
  return request({
    url: "/admin/assets/categories/" + id + "/",
    method: "get"
  });
}

// 新增资产分类
export function addCategories(data) {
  return request({
    url: "/admin/assets/categories/",
    method: "post",
    data: data
  });
}

// 修改资产分类
export function updateCategories(data) {
  return request({
    url: "/admin/assets/categories/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除资产分类
export function delCategories(id) {
  return request({
    url: "/admin/assets/categories/" + id + "/",
    method: "delete"
  });
}

// 导出资产分类
export function exportCategories(query) {
  return request({
    url: "/admin/assets/categories/export/",
    method: "get",
    params: query
  });
}
export function importsCategories(data) {
  return request({
    url: "/admin/assets/categories/import/",
    method: "post",
    data: data
  });
}
